I have an integer variable called numAttr which I fill using the find function. I then need to change this integer to a string to send it to a function that sets the text within an Excel spreadsheet. For some reason, though, DXL doesn't like the way I'm using the stringOf function. Here is the code I'm using:
for obj in currMod do {
for o in skAttrs do {
attribName = (string key skAttrs);
if (obj.attribName"" != "") {
//Increment the value in the skip list
if (find(skAttrs, attribName, numAttr)) {
delete(skAttrs, attribName);
put(skAttrs, attribName, numAttr++);
}
}
}
}
close(currMod);
//Now print the attribute counts into the spreadsheet
for o in skAttrs do {
if (!bModNamePrinted) {
setCell(rowNum, 1, num(itemRef));
bModNamePrinted = true;
}
setCell(rowNum, 2, "Object");
attribName = (string key skAttrs);
setCell(rowNum, 3, attribName);
if (find(skAttrs, attribName, numAttr)) {
strNumAttr = stringOf(numAttr);
setCell(rowNum, 4, strNumAttr);
}
rowNum++;
}
When I try to run this code, however, I am getting the error: incorrect arguments for function (stringOf) occurring on the first line of the last if-statement. What am I doing wrong?
Chris Christopher Cote - Tue May 28 13:28:32 EDT 2019 |
Re: Trouble using stringOf(integer) For some reason there is no "stringOf(int)" - you just cast the integer to a string by concatenation with an empty string: strNumAttr = numAttr "" |
Re: Trouble using stringOf(integer) PekkaMakinen - Tue May 28 13:40:13 EDT 2019 For some reason there is no "stringOf(int)" - you just cast the integer to a string by concatenation with an empty string: strNumAttr = numAttr "" Thank you Pekka. You would think that they would be consistent with how you do certain things. I'm assuming that any base types would be done the same way (i.e. int and bool). |